package com.rsc.learningbar.enumer;


import lombok.Data;
import org.springframework.stereotype.Component;

import java.util.ArrayList;
import java.util.List;

@Component
@Data
public class MemoryType {
    private List<MemoryTrace> trace;

    {
        trace = new ArrayList<>();
        trace.add(MemoryTrace.newInstance(1, 5));
        trace.add(MemoryTrace.newInstance(2, 30 * 60));
        trace.add(MemoryTrace.newInstance(3, 12 * 3600));
        trace.add(MemoryTrace.newInstance(4, 24 * 3600));
        trace.add(MemoryTrace.newInstance(5, 2 * 24 * 3600));
        trace.add(MemoryTrace.newInstance(6, 4 * 24 * 3600));
        trace.add(MemoryTrace.newInstance(7, 7 * 24 * 3600));
    }


    @Data
    public static class MemoryTrace {
        private int type;
        private int time;

        private MemoryTrace(int type, int time) {
            this.type = type;
            this.time = time;
        }

        public static MemoryTrace newInstance(int type, int time) {
            return new MemoryTrace(type, time);
        }


    }

}
